package com.kuzlak.cms.module.sys.model;


import com.kuzlak.cms.module.sys.entity.SysMenu;

import java.util.HashMap;
import java.util.Map;

public class DataModel {

    public static Map<String, Object> getCategory(SysMenu data) {

        Map<String, Object> map = new HashMap<>();
        map.put("value", data.getId());
        map.put("title", data.getName());

        map.put("id", data.getId());
        map.put("name", data.getName());
        map.put("icon", data.getIcon());
        map.put("type", data.getType());
        map.put("sort", data.getSort());
        map.put("routePath", data.getRoutePath());
        map.put("compPath", data.getCompPath());
        map.put("permsKey", data.getPermsKey());
        map.put("params", data.getParams() == null ? "" : data.getParams());
        map.put("parentId", data.getParentId());
        map.put("status", data.getStatus());
        return map;
    }


    public static Map<String, Object> getMenu(SysMenu data) {

        Map<String, Object> map = new HashMap<>();
        map.put("name", data.getName());
        map.put("icon", data.getIcon());
        map.put("path", data.getRoutePath() == null ? "" : data.getRoutePath());
        map.put("component", data.getCompPath() == null ? "" : data.getCompPath());

        return map;
    }

}
